/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.tfb.users;

import java.util.ArrayList;
import java.util.List;
 
/**
 *
 * @author Ilija
 */
public class UserStore {

    public static List<User> store = new ArrayList<User>();

    public static void addUser(String username, String password,String firstName, String lastName, String email){
        User user = new User(username, password, firstName, lastName, email);
        store.add(user);
    }

    public static User findUser(String userName){
        int indexOfUser=store.indexOf(new User(userName,null,null,null,null));
        if(indexOfUser==-1){
            return null;
        }else{
            return store.get(indexOfUser);
        }
    }
}